package com.woniuxy.carrental.service.impl;

import com.woniuxy.carrental.entity.Supply_car;
import com.woniuxy.carrental.entity.Supply_part;
import com.woniuxy.carrental.mapper.Supply_partMapper;
import com.woniuxy.carrental.service.SupplyPartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author xilei
 * @create 2021-10-05 下午 6:21
 */
@Service
public class SupplyPartServiceImpl implements SupplyPartService {

    @Resource
    Supply_partMapper supply_partMapper;

    @Override
    public List<Supply_part> findSupply_part() {
        List<Supply_part> list = supply_partMapper.findSupply_part();
        return list;
    }

    @Override
    public Supply_part findSupply_partBysupply_part_id(Integer supply_part_id) {
        Supply_part part = supply_partMapper.findSupply_partBysupply_part_id(supply_part_id);
        return part;
    }

    @Override
    public List<Supply_part> findSupply_partBysupplier_id(Integer supplier_id) {
        List<Supply_part> list = supply_partMapper.findSupply_partBysupplier_id(supplier_id);
        return list;
    }

    @Override
    public List<Supply_part> findSupply_partBy(Integer pageIndex, Integer pageSize) {
        List<Supply_part> list = supply_partMapper.findSupply_partBy(pageIndex, pageSize);
        return list;
    }

    @Override
    public List<Supply_part> findSupply_partBycarpart_id(Integer pageIndex, Integer pageSize, Integer carpart_id) {
        List<Supply_part> list = supply_partMapper.findSupply_partBycarpart_id(pageIndex, pageSize, carpart_id);
        return list;
    }

    @Override
    public List<Supply_part> findSupply_partByPage(Integer pageIndex, Integer pageSize) {
        List<Supply_part> list = supply_partMapper.findSupply_partByPage(pageIndex, pageSize);
        return list;
    }

    @Override
    public void updateSupply_part(Integer carpart_id, Integer supplier_id, Integer part_sprice, Integer part_allcount) {
        supply_partMapper.updateSupply_part(carpart_id, supplier_id, part_sprice, part_allcount);
    }

    @Override
    public void updateSupply_partBysupply_part_id(Integer supply_part_id, Integer part_allcount) {
        supply_partMapper.updateSupply_partBysupply_part_id(supply_part_id, part_allcount);
    }

    @Override
    public void deleteSupply_part(Integer supply_part_id) {
        supply_partMapper.deleteSupply_part(supply_part_id);
    }

//    @Override
//    public void insertPurchase(String purchase_id, Date purchase_date, String car_name, String carpart_name, String supplier_name, Integer car_count, Integer part_count, Integer part_allsprice, Integer car_allsprice) {
//
//    }

    @Override
    public void insertSupply_part(Supply_part supply_part) {
        supply_partMapper.insertSupply_part(supply_part);
    }
}
